The present invention relates to message transfers and more particularly to message transfers well suited to the varying connection environments of mobile computing.
In mobile applications, such as with personal data assistants (PDAs), smart telephones or laptop computers, often times off-line processing (or xe2x80x9cintermittently connected operationsxe2x80x9d) may be carried out so as to work without being continuously connected to a network or other processing system. One aspect of off-line processing involves the transfer of messages between the mobile processing system to the network or other processing system.
Conventional off-line processing for message transfers typically would result in a queue of message transfers. The message transfers would be made in a serial fashion when a connection was established. Typically, if the connection was lost during the message transfer, the message transfer may have to be started all over. Thus, for example, in file transfers, if the connection was lost, the entire file transfer may have to be started from the beginning of the file.
Various systems have been developed in attempts to overcome limitations of data transfers. For example, U.S. Pat. No. 5,751,719 to Chen et al. entitled METHOD AND SYSTEM FOR DATA TRANSFER IN THE PRESENCE OF DISCONNECTS describes methods and systems for controlling data transfer operations during a communication between a transmitter and a receiver. Data packets which have been stored at the receiver remain stored there even after a disconnect to avoid the need for retransmitting the data packets. Data transmission is then resynchronized after the connection is reestablished.
Another example of a checkpoint system is provided in certain implementations of the Internet File Transfer Protocol (FTP). These implementations allow checkpointing of individual file transfers, however, they typically do not provide checkpointing for multiple file transfers. FTP implementations also use multiple transport-level connections which may be impractical for many mobiles users, particularly those that use wireless networks.
Other checkpoint or restarting systems are described in U.S. Pat. Nos. 5,121,479, 5,269,017, 5,446,904, 5,551,043, 5,758,174, 5,765,004, and 5,802,267. Other checkpoint or restart systems are also described in IBM Technical Disclosures Vol. 38, No. 9, pp. 191-93 (1995) and Vol. 31, No. 5, pp. 409-410 (1988).
While various systems have been developed for checkpointing or restarting communications, in a mobile environment where the characteristics of the connection may vary widely, for example, from direct network connection to low speed connection over a wireless modem, the communication protocols which implement these systems may be cumbersome. For example, the single phase and two phase commit sequences as described in the background of PCT Publication WO 95/10805 entitled MESSAGE TRANSMISSION ACROSS A NETWORK, includes a commit sequence where each side of a transaction remains synchronized by responding to a commit instruction at sync points. If the commit cannot be synchronously carried out, then the participants in the transaction must resynchronize. In the two phase commit sequence, a prepare phase is included in the sequence. In the prepare phase it is determined if a commit instruction could be carried out. If the prepare phase determines that the commit may be carried out, then the commit is carried out. However, if the prepare phase determines that the commit may not be carried out, then the current transaction is backed out to the last common commit point (i.e. resynchronized).
The particular system of WO 95/10805 describes commit processing where a successful receipt of a message by a receiver program results in transmitting to the sender a positive confirmation of receipt and an unsuccessful receipt results in sending to the sender a negative confirmation of receipt. PCT publication WO 95/10805 describes the system as sending a xe2x80x9cbatchxe2x80x9d of messages from the sender to the receiver and then either confirming success or failure of the entire batch. However, such a batch system still may involve overhead for the successful/unsuccessful confirmation message and, furthermore, may require retransmission of entire batches if the transmission is unsuccessful. Thus, if the batches of messages are large, the number of messages which must be re-transmitted may be large and may consume large amounts of system resources to maintain the messages until the commit is received. However, if the batches are small so as to reduce system resource requirements and re-transmission requirements, then the number of commit messages increases which may increase overhead and result in associated message delays.
Similarly, other systems for synchronization, fault tolerance of communications between devices or commit procedures include U.S. Pat. Nos. 5,261,089, 5,276,876, 5,319,773, 5,319,774, 5,371,886, 5,428,771, 5,432,926, 5,546,582, 5,561,797, 5,613,060, and 5,768,538, PCT Publication No. WO 97/46939, and IBM Technical Disclosure Bulletins, Vol. 34, No. 7B, pp. 334-338 (December 1991), Vol. 36, No. 12, pp. 65-66 (December 1993) and Vol. 39, No. 1, pp. 79-80 (January 1996).
While these previous systems may allow for fault tolerance in communications, the number of communications required to carry out the fault tolerant procedure may be overly burdensome in some communication environments. For example, over a low speed communication link it may be desirable to minimize protocol overhead so as to maximize data transfer. However, in light of the unreliable nature of communication connections in a mobile computing environment it is also desirable to provide tolerance of faults in the communication connection which typically results in increased protocol overhead for communications.
Thus, despite previous efforts, a need still exists for improvements in communications, in particular in the mobile environment, which may include varying connection types with differing levels of reliability.
In view of the above discussion, it is an object of the present invention to provide for efficient fault tolerant message transfer in differing and unreliable communication environments.
A further object of the present invention is to provide message transfers suitable for use with devices of differing capabilities.
Still another object of the present invention is to provide a message transfer mechanism which is tolerant of disconnect events.
These and other objects of the present invention are provided by communicating between a source device and a destination device over an external communication link by transmitting a message stored in a source persistent queue at the source device over the external communication link to the destination device. The transmitted message has transmitted with it an associated sequence identifier which identifies the message stored in the source persistent queue. The transmitted message and the associated sequence identifier are received at the destination device and the received message and the associated sequence identifier stored in a destination persistent queue at the destination device. A commit message is transmitted to the source device from the destination device. The commit message identifies a largest sequence identifier of consecutive sequence identifiers associated with received messages of a sequence of messages which have been persistently stored in the destination persistent queue. The persistently stored message in the destination persistent queue is made available to users of the destination device independent of whether a commit message identifying the message has been transmitted to the source device.
By maintaining persistent queues on each device and then communicating commit messages between the device, the persistent queues may be maintained in synchronization while maintaining the messages transmitted and received across sessions. By occasionally sending commit messages, commit messages need not be transmitted with each message. Thus, overhead associated with sending commit messages may be reduced. Furthermore, by making the received messages available independent of the commit message being transmitted to the source device and allows commit messages to be transmitted less frequently without affecting message availability. Thus, the present invention allows data to be more quickly available to applications communicating using the message queues.
In a further embodiment of the present invention, the source device may receive a commit message from the destination device and then discards from the source persistent queue, messages having associated sequence identifiers which are not greater than the sequence identifier of the received commit messages. Furthermore, the discards may take place after receiving multiple commit messages, where the highest sequence identifier received is used to discard messages. Thus, the source device may discard multiple messages from the source persistent queue without having to receive multiple messages from the destination device. Such a cumulative commit procedure may also allow for more rapid re-synchronization as a single message may indicate commits for multiple messages. Also, in contrast with a batch procedure, if a message was committed at the destination queue, then that message need not be re-transmitted, even if the commit message is lost as the commit would be reflected in a subsequent commit message. Furthermore, because the commit messages are cumulative, the discard procedure at the source may be asynchronous and performed at a time which minimizes any performance impact that carrying out the discard procedure may have on the communications between the source and the destination.
In another embodiment of the present invention, it is determined if a new connection between the source device and the destination device has been established. Responsive to determining if a new connection has been established, the highest sequence identifier of a message persistently stored in the destination persistent queue is transmitted from the destination device to the source device. Furthermore, in such an embodiment, a message stored in the source persistent queue having an associated sequence identifier which is a next greater sequence identifier than the sequence identifier received from the destination device may be determined responsive to determining if a new connection has been established. Transmission of messages stored in the source persistent queue to the destination device then begins from the determined message stored in the source persistent queue having an associated sequence identifier which is a next greater sequence identifier than the sequence identifier received from the destination device. Also, messages from the source persistent queue having an associated sequence identifier which is not greater than the highest sequence identifier received from the destination device may be discarded.
In such an embodiment, the restart of message transmission as well as the discarding of messages in the source persistent queue may be accomplished with the resync message received after connection. Thus, the re-synchronization may be accomplished rapidly and efficiently utilizing the persistent queues and the cumulative commit procedure. By utilizing the cumulative commit procedure, messages which were committed in the destination queue but for which a commit message was not sent in the previous connection, need not be discarded or re-transmitted. Thus, the amount of re-transmitted messages is reduced to those messages which were sent but not committed at the destination.
In still another embodiment of the present invention, a resync message is transmitted from the source device to the destination device. Responsive to receiving a resync message, the highest sequence identifier of a message persistently stored in the destination persistent queue is transmitted from the destination device to the source device. Such a commit on request procedure allows the queues to operate asynchronously with regard to commits but cooperatively if the source persistent queue were to, for example, need to free space by discarding committed messages.
In a further embodiment, when a request from a user application of the destination device for a message received from the source device is received, it is determined if a received message and an associated sequence identifier are stored in the destination persistent queue at the destination device have an associated sequence identifier which is not greater than a highest sequence identifier associated with a persistently stored message. The requesting user application may then be provided a message stored in the destination persistent queue with the smallest sequence identifier if a received message and an associated sequence identifier is stored in the destination persistent queue at the destination device has an associated sequence identifier which is not greater than a highest sequence identifier associated with a persistently stored message.
As will further be appreciated by those of skill in the art, the present invention may be embodied as methods, systems or computer program products.